package com.yiji.fintech.musfinance.facadeimpl.depositback;

import com.acooly.core.utils.enums.ResultStatus;
import com.alibaba.dubbo.config.annotation.Service;
import com.yiji.fintech.musfinance.center.depositback.api.DepositBackFacade;
import com.yiji.fintech.musfinance.center.depositback.order.facade.DepositBackFacadeOrder;
import com.yiji.fintech.musfinance.center.depositback.result.DepositBackResult;
import com.yiji.fintech.musfinance.common.dispatcher.Dispatcher;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * 充退
 * Created by ouwen@yiji.com} on 2017/10/16.
 */
@Service(version = "1.0")
public class DepositBackFacadeImpl implements DepositBackFacade{
    @Autowired
    private Dispatcher dispatcher;

    @Override
    public DepositBackResult depositBack(DepositBackFacadeOrder depositBackOrder) {
        DepositBackResult result = new DepositBackResult();
        result.setStatus(ResultStatus.processing);
        result.setCode(ResultStatus.processing.code());
        result.setDetail(ResultStatus.processing.getMessage());
        dispatcher.doExcute(depositBackOrder,result);
        return result;
    }
}
